//
// Created by 24087 on 2025/10/12.
//

#ifndef COREXY_KINEMATICS_KINEMATICS_H
#define COREXY_KINEMATICS_KINEMATICS_H
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <math.h>


/*单个电机配置文件*/
typedef struct Motor
{
    bool direction;
    uint32_t distance;
} Motor;


/*  解算器输出配置文件
 *
 */
typedef struct MotorCfg_Up
{
    unsigned char direction_a;
    unsigned char direction_b;
    float distance_a;
    float distance_b;
} MotorCfg_Up;

/*坐标配置文件*/
typedef struct Coordinate
{
    float x_value;
    float y_value;
} Coordinate;

/*常用量定义*/
enum
{
    CW = 0,
    CCW = +1,
};


Coordinate CoreXY_Forward_Kinematics(Coordinate cordi_now, MotorCfg_Up cfg);

MotorCfg_Up CoreXY_Inverse_Kinematics(Coordinate cordi_now, Coordinate cordi_target);
#endif //COREXY_KINEMATICS_KINEMATICS_H
